﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CollegeSim.CourseScheduler.Domain.Entities;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CollegeSim.CourseScheduler.Domain.Test
{
    // Author: Ryan Redburn
    // Project: Course Scheduler
    // Date: 2/24/2014

    [TestClass]
    public class InstructorTest
    {
        #region [ Property Tests ]

        [TestMethod]
        public void OfficeNumberShortLengthTest()
        {
            var assert = false;

            try
            {
                var instructor = new Instructor
                {
                    FirstName = "Ryan",
                    LastName = "Redburn",
                    PhoneNumber = "123-456-7890",
                    Email = "rredburn@email.com",
                    OfficeNumber = "IS201"
                };

                instructor.OfficeNumber = "IS21";
            }
            catch (ArgumentOutOfRangeException)
            {
                assert = true;
            }
            finally
            {
                Assert.IsTrue(assert);
            }
        }

        [TestMethod]
        public void OfficeNumberExcessLengthTest()
        {
            var assert = false;

            try
            {
                var instructor = new Instructor
                {
                    FirstName = "Ryan",
                    LastName = "Redburn",
                    PhoneNumber = "123-456-7890",
                    Email = "rredburn@email.com",
                    OfficeNumber = "IS201"
                };

                instructor.OfficeNumber = "IS2001";
            }
            catch (ArgumentOutOfRangeException)
            {
                assert = true;
            }
            finally
            {
                Assert.IsTrue(assert);
            }
        }

        #endregion
    }
}
